<!-- Web Upload to check user name, password PHP File -->
<!-- Reveions History ...
	Rev 1.00 at 2015/06/07 by Max Yin:
		1. First time create
	Rev 1.01 at 2015/07/08 by Max Yin:
		1. 由標楷體, 改成新細明體
-->
<html>
	<body background="pic/background_06.gif">
	<head>
		<font face="新細明體,time new roman,Arial">
			<base target="_top"/>
		<meta charset="UTF-8">
	</head>
	<body>
		<center>
			<?php
				require_once('class_package/common.php');
				$admin_member = new member();
				$login_useramne = $_POST['accout_username'];
				$login_password = $_POST['accout_password'];
				
				// To check user name & password limit ...
				if ( $login_useramne == '' || $login_password == '' ) {
					echo "<script>alert('输入的栏位中, 不能为空值, 请重新输入...');history.go(-1);</script>";
					exit();
				}
				
				// To check MySQL exist the account user name and password or not?
				$get_query_result = account_search_result($login_useramne);
				if ( !is_array($get_query_result) ) {
					echo "<script>alert('查无此帐号/密码? 请检查后,重新输入...');history.go(-1);</script>";
					exit();
				}
				
				$get_query_password = AnalyzeMySqlStr($get_query_result,'password');
				if ( $login_password != $get_query_password ) {
					echo "<script>alert('帐号/密码错误! 请重新输入...');history.go(-1);</script>";
					exit();
				}
				$getRealName = $admin_member->SpecialName_Mapping($login_useramne);
				setcookie('login_user',$getRealName);
				
				// 由 user name 去判断, 是否为 admin 成员 ...
				$is_admin_member = 0;
				foreach ( $admin_member->getMembers() as $value ) {
					if ( $login_useramne == $value ) {
						$is_admin_member = 1;
						break;
					}
				}
				
				$re =getpowr($login_useramne);
				if($re){
					$is_admin_member = 1;
				}
				
				// 跳转 html 到 Admin成员 或 一般成员...  $url="$web_ip/webul_main_admin.html";   $url="$web_ip/webul_main.html"; 
				$web_ip = html::WebIP;
				if ( $is_admin_member == 1 )
					$url="$web_ip/0201_webul_admin.html";
				else
					$url="$web_ip/0201_webul_common.html"; 
				
				Header("HTTP/1.1 303 See Other"); 
				Header("Location: $url");
				exit();
			?>
		</center>
	</body>
</html>


